package map_set;

import java.util.HashSet;

import java.util.Scanner;
import java.util.Set;

//牛客坏掉的键盘
public class BadKeyBoard {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String expectedstr = null;
        String actualstr = null;
        while (scanner.hasNext()){
            expectedstr = scanner.next();
            actualstr = scanner.next();
        }
        //转大写
        expectedstr = expectedstr.toUpperCase();
        actualstr = actualstr.toUpperCase();
        //将实际输入的字符串存入set中
        Set<Character> set1 = new HashSet<>();
        for (int i = 0; i < actualstr.length(); i++) {
            set1.add(actualstr.charAt(i));
        }
        //将实际输出的值存在set2中、、去重
        Set<Character> set2 = new HashSet<>();
        for (int i = 0; i < expectedstr.length(); i++) {
            if (!set1.contains(expectedstr.charAt(i))){
                if (set2.add(expectedstr.charAt(i))){
                    System.out.print(expectedstr.charAt(i));
                }

            }
        }
        System.out.println();


    }
}
